package com.zd.wechatPlatform.common.enums;

/**
 * 微信消息类型枚举
 * 
 * @author lishi
 * @date 2018年10月31日 下午5:40:16
 */
public enum WeixinMsgTypeEnum {
	event("event", "事件消息"),
	text("text", "文本消息"),
	image("image", "图片消息"),
	voice("voice", "语音消息"),
	video("video", "视频消息"),
	shortvideo("shortvideo", "短视频消息"),
	location("location", "位置消息"),
	link("link", "链接消息");

	private String key;
	private String value;

	private WeixinMsgTypeEnum(String key, String value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public static WeixinMsgTypeEnum get(String key) {
		for (WeixinMsgTypeEnum msgType : WeixinMsgTypeEnum.values()) {
			if (msgType.getKey() == key) {
				return msgType;
			}
		}
		return null;
	}
}
